package com.dream.libmp3lame.utils;

public class ArrayUtils {
    public static int toShortLittle(byte[] src,short[] des,
                                       int size,boolean isLittle) {

        int count = size/2;

        if (isLittle){
            for (int i = 0; i < count; i++) {
                des[i] =
                        (short) (src[i * 2+1] << 8 | src[2 * i] & 0xff);
            }
        }else {
            for (int i = 0; i < count; i++) {
                des[i] =
                        (short) (src[i * 2] << 8 | src[2 * i+1] & 0xff);
            }
        }

        return count;
    }
}
